/**
 * @name basic-block-gen
 * @id python/basic-block-gen
 */

import python
import util

// from BasicBlock b1, BasicBlock b2
// where 
// b1 != b2 and 
// b2=b1.getImmediateDominator()

// select b1, b2
from File f,BasicBlock block,string node_type,string node_value,string node_location,Scope scope,string block_location,string filepath
where
scope=block.getScope()
and
prepare_basicblock_node_id(block, node_type, node_value, filepath, node_location, block_location)
//prepare_basicblock_node_id(block, node_type, node_value, filepath, node_location, block_location, startline, startcolumn, endline, endcolumn)
and
prepare_cfg_node_id(block.getLastNode(), node_type, node_value, node_location)
and
f=scope.getEnclosingModule().getFile()
and
isSource(f)
select block,filepath,scope,node_type,node_value,node_location,block_location